<?php 
	$this->headLink()->appendStylesheet( $this->baseUrl() . '/public/css/jquery.ui.stars.css?v=06082010' );
	$this->headScript()->appendFile( $this->baseUrl() . '/public/js/jquery.ui.stars.min.js' );
?>

<!--[if lte IE 8.0]>
<script type="text/javascript" src="<?php echo $this->baseUrl() . '/public/js/fix-zindex.js'; ?>"></script>
<![endif]-->


<div class="box">
	
	<div class="prodpage">
		<div class="top">
		<p><?php echo $this->translate( 'product_categories' ) ?>: <span>
			<?php 
			$i = 0;
			foreach( $this->categories as $value ) {
				if( $i < 1 ) {
					echo '<a href="' . $this->baseUrl() . '/shop/show/id/' . $value['Categries']['c_id'] . '/p/' . $value['Categries']['parent_id'] . '/' . $this->Seo( $value['Categries']['name_' . $this->locale] ) . '">' . $value['Categries']['name_' . $this->locale] . '</a>';
				} else {
					echo ', <a href="' . $this->baseUrl() . '/shop/show/id/' . $value['Categries']['c_id'] . '/p/' . $value['Categries']['parent_id'] . '/' . $this->Seo( $value['Categries']['name_' . $this->locale] ) . '">' . $value['Categries']['name_' . $this->locale] . '</a>';
				}
				$i++;
			} 
			?></span>
		</p>
		</div>		
		<div class="acenter">
			<a class="button prodmenu" onclick="showsection('.sec1')"><?php echo $this->translate( 'product_description' ) ?></a>
			<a class="button prodmenu" onclick="showsection('.sec2')"><?php echo $this->translate( 'product_review' ) ?></a>
			<a class="button prodmenu" onclick="showsection('.sec3')"><?php echo $this->translate( 'product_application' ) ?></a>
			<a class="button prodmenu" onclick="showsection('.sec4')"><?php echo $this->translate( 'product_specification' ) ?></a>
		</div>
	</div>
	
	<div class="column" style="margin:25px 0">
		
		<div class="colimg" style="background-image:url(<?php echo $this->File($this->item['img'], 195) ?>)"></div>
		
		<div class="coltext">
			<div class="prod">
				<div class="name"><?php echo $this->item['name_' . $this->locale] ?><p class="price"><?php echo $this->PriceSpecial( $this->item, $this->priceRank, $this->locale, true ) ?></p></div>
					
					<div class="text sec1 prodsection none">
    				<?php echo $this->item['description_' . $this->locale]; ?> 
    				</div>
				
    				<div class="text sec2 prodsection none">
    				<?php echo $this->item['application_' . $this->locale]; ?> 
    				</div>
    				
    				<div class="text sec3 prodsection none">
    				<?php echo $this->item['application_' . $this->locale]; ?> 
    				</div>
    				
    				<div class="text sec4 prodsection none">
    				<?php echo $this->item['specification_' . $this->locale]; ?> 
    				</div>
				
				<div class="avail">					
					<img src="{baseUrl}/public/images/bgreen.jpg" alt=""><?php echo $this->translate( 'product_available' ) ?>
				</div>
			</div> 
		</div>
	<div class="clr"></div>
	</div>
	
	<div class="line"></div>
	<table class="prodoption">
		<tr>
			<td class="aright"></td>
			<td class="aleft">

			</td>
			<td class="aright"></td>
			<td class="aleft">

			</td> 
			<td class="aright"><a id="addtobasket" href="{baseUrl}/shop/basket/add/<?php echo $this->item['ps_id'] ?>/dem/10000000/items/1/special/1" class="button bold"><?php echo $this->translate( 'add_to_basket' ) ?></a></td>
		</tr>
	</table>
	<div class="line"></div>
	
	<div class="acenter" style="margin:23px auto 10px auto">
		<a href="{baseUrl}/shop" class="button"><?php echo $this->translate( 'product_back' ) ?></a>
		<a id="feedback-btn" href="javascript:void(null);" class="button"><?php echo $this->translate( 'product_share' ) ?></a>
		<a href="{baseUrl}/shop/wishlist/id/<?php echo $this->item['ps_id'] ?>" class="button"><?php echo $this->translate( 'product_add_fav' ) ?></a>
	</div>
	<?php echo $this->inlineScript()->setScript( '$(document).ready(function(){
		$("#feedback-btn").click(function(){
			if( $("#feedback-table").is(":visible") ) {
				$(this).css("color","#fff");
				$("#feedback-table").css({ display: "none" });
			} else {
				$(this).css("color","#fcb62d");
				$("#feedback-table").css({ display: "block" });
			}
		});
		

		
		$.validator.setDefaults({
			submitHandler: function(e) { 
				var fields = $(e).find( "input.style1" );
				
				$("#feedback-table").animate({
					opacity: 0
				}, 1000, null, function(){
					$( this ).css({ display: "none", opacity: 1 });
				});

				$.post(
					baseUrl + "/shop/feedback",
					{
						from : $( "#cyouremail" ).val(),
						to : $( "#cemail" ).val(),
						prod : ' . $this->item['ps_id'] . '
					},
					function( resp ){
						if( !resp.status ) {
							alert( "' . $this->translate( 'feedback_email_error' ) . '" );
						} else {
							alert( "' . $this->translate( 'feedback_email_ok' ) . '" );
						}
					},
					"json"
				);
			}
		});
		
		$("#feedback-form").validate({
			rules: {
				email: {
					required: true,
					email: true
				},
				youremail: {
					required: true,
					email: true
				}
			},
			messages: {
				email: "' . $this->translate( 'feedback_email_error' ) . '",
				youremail: "' . $this->translate( 'feedback_email_error' ) . '"
			}
		});
	});' ); ?>
	<form id="feedback-form" onsubmit="return false;">
		<table id="feedback-table" class="mcenter mtop20" style="width:90%;display:none;">
		<tr>
		<td style="width:40%"><?php echo $this->translate( 'product_email' ) ?>:</td>
		<td><input class="style1" type="text" id="cemail" name="email" style="width:350px"></td>
		</tr>
		<tr>
		<td style="width:40%"><?php echo $this->translate( 'product_your_email' ) ?>:</td>
		<td><input class="style1" type="text" id="cyouremail" name="youremail" style="width:350px"></td>
		</tr>
		<tr>
		<td colspan="2" class="aright">
		<div class="aright">
			<a href="javascript:;" id="feedback-send"  class="button" onclick="$('#feedback-form').submit()"><?php echo $this->translate( 'product_dispatch' ); ?></a>
		</div>
<!--		<input type="submit" name="" value="<?php echo $this->translate( 'product_dispatch' ); ?>" class="button2"></td>-->
		</tr>
		</table>
		
	</form>
	<div class="end"></div>
</div>
<!-- end box -->

<script type="text/javascript">

	function showsection(com)
	{
		$('.prodsection').hide();
		$(com).show();
	}

	$(document).ready(function(){

		$('.prodmenu').click(function(){
			$('.prodmenu').removeClass('buttonactive');
			$(this).toggleClass('buttonactive');
		});

		$('.prodmenu').eq(0).trigger('click');
		
	});

</script>

<!--  POLECANE PRODUKTY  -->
<?php if( $this->link->getFirst() ) { ?>
	<h2><?php echo $this->translate( 'product_recommended' ) ?></h2>
	<div class="content">
	<?php $i = 0; foreach( $this->link as $value ) { ?>

	<div class="boxprodmini">
		<div class="boximg" style="background-image:url(<?php echo $this->File( $value['Galeries']['Photos']->toArray(), 195 ) ?>)"><a href="{baseUrl}/shop/item/id/<?php echo $value['lps_id'] ?>/<?php echo $this->Seo( $value['name_' . $this->locale] ) ?>"></div>
		<div class="name"><a href="{baseUrl}/shop/item/id/<?php echo $value['lps_id'] ?>/<?php echo $this->Seo( $value['name_' . $this->locale] ) ?>"><?php echo $value['name_' . $this->locale] ?></a></div>
		<?php $free = $this->Findfree( $value['Dimension'] ); ?>
		<div class="price"><?php echo $this->Price( $value, $free, $this->locale, true ) ?></div>
	
		<div class="avail">
		
		<?php 
		if($value['Dimension'][$free]['stock'] > 0) { ?>
			<img src="{baseUrl}/public/images/bgreen.png" alt="">
			<?php if( $value['wishlist'] == 'no' ) { ?>
				<a href="{baseUrl}/shop/basket/add/<?php echo $value['ps_id'] ?>/dem/<?php echo $value['Dimension'][$free]['d_id'] ?>" ><?php echo $this->translate( 'add_to_basket' ) ?></a>
			<?php } ?>
		<?php } else {?>
			<img src="{baseUrl}/public/images/bred.png" alt="">
			<a href="{baseUrl}/shop/wishlist/id/<?php echo $value['ps_id'] ?>" ><?php echo $this->translate( 'add_to_whishlist' ) ?></a>
		<?php }	?>
		</div>
		
		<?php if($new==1) echo '<div class="new"></div>';  ?>
	</div>
	
	</div>
	

<?php } ?>
<?php } ?>


<div class="clr"></div>